<?php

namespace App\Models;

class ArticleCate extends Base
{
    protected $table = 'article_cate';

    protected $guarded = [];

    public function articles()
    {
        return $this->hasMany(Article::class, 'cate_id');
    }

    /**
     * 是否被使用过
     */
    public function isUsed($id, $param = '')
    {
        if (!$id) {
            return ['code' => 0, 'msg' => '参数错误'];
        }

        // 软删除
        return ['code' => 2, 'msg' => ''];
    }
}
